const proxy = require('http-proxy-middleware')

module.exports = function (app) {
  app.use(
    proxy('/api', {
      target: "https://www.runoob.com",
      changeOrigin: true,
      pathRewrite: { '^/api': '' }
    }),
    proxy('/api2', {
      target: "https://www.baidu.com",
      changeOrigin: true,
      pathRewrite: { '^/api2': '' }
    })
  )
}